//优惠券相关
import request from '../utils/request.js'

// 获取优惠券列表
const getCouponList = data => {
  return request({
    url: '/api/auth/coupon/list',
    method: 'POST',
    data
  })
}
// 获取优惠券详情
const getCoupon = id => {
  return request({
    url: '/api/auth/coupon/get/' + id,
    method: 'POST'
  })
}
// 获取优惠券详情
const getUserCoupon = (data) => {
  return request({
    url: '/api/auth/coupon/userCoupon',
    method: 'POST',
    data
  })
}
// 获取下单可用优惠券列表
const getUseCoupon = (id,totalPrice) => {
  return request({
    url: '/api/auth/coupon/use/' + id+'/'+totalPrice,
    method: 'POST'
  })
}
module.exports = {
  getCouponList,
  getCoupon,
  getUserCoupon,
  getUseCoupon

}